package nowcoder;


import java.util.Scanner;

/**
 * 计算字符串最后一个单词的长度，单词以空格隔开。
 */
public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String str;
        while (input.hasNextLine()) {
            str = input.nextLine();
            String[] strArray = str.split(" ");
            for (int i = strArray.length - 1; i >= 0; i--) {
                String string = strArray[i];
                if (!string.isEmpty()) {
                    System.out.println(string.length());
                    break;
                }
            }
        }
    }
}
